package com.lemote.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 流程
 * @author wuhui
 * @time 2011-7-16 下午10:48:42
 * @Version:0.0.1
 * @since smt
 */
@Entity
@Table(name="smt_flow")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Flow extends IdEntity {

	private String flowName;
	
	private List<FlowTask> tasks;

	
	public String getFlowName() {
		return flowName;
	}

	@OneToMany(mappedBy = "flow", fetch = FetchType.LAZY, targetEntity = FlowTask.class)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	public List<FlowTask> getTasks() {
		return tasks;
	}

	public void setFlowName(String flowName) {
		this.flowName = flowName;
	}

	public void setTasks(List<FlowTask> tasks) {
		this.tasks = tasks;
	}
	
	
}
